const label = '分类列表'
const name = 'DkAppCategoryList'

export default {
  icon: 'tdesign:work',
  label,
  name,
  count: 1,
  rule() {
    return {
      type: name,
      props: {
        imageStyle: {
          width: '40px',
          height: '40px',
          marginBottom: '10px',
          borderRadius: '10px'
        },
        cardStyle: {
          marginLeft: '10px',
          marginRight: '10px',
          marginTop: '10px',
          marginBottom: '10px',
          paddingLeft: '10px',
          paddingRight: '10px',
          paddingTop: '10px',
          paddingBottom: '10px',
          backgroundColor: 'rgba(255, 255, 255, 1)',
          borderRadius: '5px',
          boxShadow: '4px 4px 3px -2px #E7E5E5FF'
        }
      },
      showStyle: true,
      children: [],
      style: {}
    }
  },
  props() {
    return [
      {
        type: 'radio',
        field: 'project',
        title: '类型',
        value: 'question',
        options: [
          { label: '问答', value: 'question' },
          { label: '测验', value: 'test' }
        ]
      },
      {
        type: 'radio',
        field: 'styleType',
        title: '样式',
        value: 'list',
        options: [
          { label: '列表', value: 'list' },
          { label: '宫格', value: 'grid' }
        ],
        control: [
          {
            value: 'grid',
            rule: [
              { type: 'number', field: 'columnNum', title: '每行个数', value: 4 },
              {
                type: 'switch',
                field: 'useImageStyle',
                title: '图片样式',
                control: [
                  {
                    value: true,
                    rule: [
                      {
                        type: 'DkStyleInput',
                        field: 'imageStyle',
                        title: '样式配置',
                        props: {
                          isDrawer: true,
                          drawerProps: {
                            title: '卡片样式',
                            size: '400px',
                            zIndex: 100
                          },
                          hideComponents: ['DkStyleFontInput', 'DkStyleBackgroundInput']
                        }
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            value: 'list',
            rule: [
              {
                type: 'DkStyleInput',
                field: 'cardStyle',
                title: '列表样式',
                props: {
                  isDrawer: true,
                  drawerProps: {
                    title: '列表样式',
                    size: '400px',
                    zIndex: 100
                  },
                  hideComponents: ['DkStyleFontInput']
                },
                value: {}
              }
            ]
          }
        ]
      },
      { type: 'DkImageInput', field: 'defaultImage', title: '默认图标', value: '' }
    ]
  }
}
